import os
import sys

BASE_DIR = Dir('#').abspath

TERMS_CPPPATH = (
	os.path.join(BASE_DIR, 'include'),
)
TERMS_SRCDIR = os.path.join(BASE_DIR, 'src')
TERMS_SOURCES = Glob(TERMS_SRCDIR + '/*.cc') + Glob(TERMS_SRCDIR + '/dl/*.cc')

##
# Build setup
#
env = Environment(
	ENV=os.environ, 
	tools=['default', 'doxygen'], toolpath='.'
)

# env.Append(CXXFLAGS=["-std=c++11", '-pedantic', '-W', '-Wall', '-O2', '-fcolor-diagnostics'])
env.Append(CXXFLAGS=["-std=c++11", '-pedantic', '-W', '-Wall', '-g', '-fcolor-diagnostics'])
env.Append(CPPPATH=TERMS_CPPPATH)
env.Append(LIBPATH='.')
env.Append(RPATH='.')

##
# Build
#
env.SharedLibrary('terms', source=TERMS_SOURCES)
# env.StaticLibrary('terms', source=TERMS_SOURCES, variant_dir='build')
# env.Doxygen('doxygen.conf')
env.SConscript(dirs='test', exports=['BASE_DIR', 'TERMS_CPPPATH'])
